package lab21;

import java.util.ArrayList;
import java.util.HashSet;
import java.util.Iterator;
import java.util.Set;

public class Stuff {

	public static void main(String[] args) {
		Set<String> list = new HashSet<String>();
		
		list.add("Pesho");
		list.add("5");
		list.add("8.92");
		list.add("21");
		list.add("spam");
		
		list.remove(2);
		
		System.out.println(list.size());
		
		System.out.println(list);
		
		ArrayList<String> l1 = new ArrayList<String>();
		l1.add("tva e v l1");
		l1.add("tva sashto e l1");
		
		list.add("You remember that fist can be a verb");
		
		System.out.println(list);
		
		l1.clear();
		System.out.println(l1);
		
	
		
		list.add("spam");
		
		System.out.println(list.contains("spam") + " " + list.contains("saffb x"));
//		System.out.println(list.indexOf("spam") + " " + list.lastIndexOf("spam"));
		System.out.println("Never gonna give you up");

		Vegetable v1=new Vegetable("Morkov");
		Vegetable v2=new Vegetable("Krastavitsa");
		
		ArrayList<Vegetable> vegetables = new ArrayList<Vegetable>();
		System.out.println(vegetables.isEmpty());
		vegetables.add(v1);
		vegetables.add(v2);
		
		ArrayList<Vegetable> veggies =  new ArrayList<Vegetable>();
		veggies.add(v2);
		veggies.add(new Vegetable("Domat"));
		
		vegetables.add(v2);
		
		System.out.println(vegetables.subList(0, 2));
		
		vegetables.removeAll(veggies);
		
		System.out.println(vegetables);
		System.out.println(vegetables.contains(new Vegetable ("Morkov")));
		
		System.out.println(vegetables.isEmpty());
		
		System.out.println("\n\n\n");
		
		Iterator<String> iter = list.iterator();
		System.out.println(list);
		while(iter.hasNext()) {
			System.out.println(iter.next());
		}
	}
}
